<template>
  <view class="index">
    <view class="jtop">
      <view class="status_bar"><!-- 这里是状态栏 --></view>
      <view class="jtop_l" @tap="navigateBack"
        ><image src="../../static/img/ic_back.png"></image
      ></view>
      <!-- <view class="jtop_l" @tap="navigateBack">关闭</view> -->
      <view class="jtop_c">未付待结</view>
    </view>
    <view class="tophr"></view>

    <view class="cli" v-if="items != ''">
      <view class="clb" @tap="to_edit(items[0].name, 1)">
        <image src="../../static/img/index/5/xx7.png"></image>
        <view class="clb_t">
          <view class="clfb_tt">
            包工
            <text>07/20更新</text>
          </view>
          <view class="clfb_tf"> 未付待结: {{ items[0].dataTxt }}元 </view>
        </view>
        <image src="../../static/img/jt.png" class="blb_r"></image>
      </view>

      <view class="clb" @tap="to_edit('机械费', 2)">
        <image src="../../static/img/index/5/xx8.png"></image>
        <view class="clb_t">
          <view class="clfb_tt">
            点工
          </view>
          <view class="clfb_tf">
            未付待结: {{ items[1].dataTxt }}元
          </view> </view
        ><image src="../../static/img/jt.png" class="blb_r"></image>
      </view>

      <view class="clb" @tap="to_edit('材料费', 3)">
        <image src="../../static/img/index/5/xx9.png"></image>
        <view class="clb_t">
          <view class="clfb_tt">
            机械
          </view>
          <view class="clfb_tf">
            未付待结: {{ items[2].dataTxt }}元
          </view> </view
        ><image src="../../static/img/jt.png" class="blb_r"></image>
      </view>

      <view class="clb" @tap="to_edit2('管理人员费用', 4)">
        <image src="../../static/img/index/5/xx10.png"></image>
        <view class="clb_t">
          <view class="clfb_tt">
            材料采购
          </view>
          <view class="clfb_tf">
            未付待结: {{ items[3].dataTxt }}元
          </view> </view
        ><image src="../../static/img/jt.png" class="blb_r"></image>
      </view>
    </view>

    <!-- 弹出层 -->
    <view :class="[ashowpop ? 'tc' : 'tc hide']">
      <view class="jtop_bj" @click="jshow_pop"></view>

      <view class="tc_fbox">
        <view class="tc_fbox_bt3" @click="build_e">
          新增工种
        </view>
        <view class="tc_fbox_bt2" @click="jshow_pop">
          汇总表格导出
        </view>
        <view class="tc_fbox_bt" @click="jshow_pop">
          取消
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import request from '@/common/request.js';
import { mapState } from 'vuex';

export default {
  data() {
    return {
      repeat_click: true,
      projectId: '',
      ashowpop: false,
      ashowpop_jrename: false,
      ashowpop_jdel: false,
      ashowpopT: false,
      bj: false,
      yd: false,
      items: [],
    };
  },

  onShow() {
    this.projectId = uni.getStorageSync('dqfull_name').id;

    request({
      url: `/modor/v1/project/${this.projectId}/finance/expenditure/profile`,
      method: 'GET',
      // data:{
      // 	workTypeId:a
      // },

      success: res => {
        console.log('1项目列表信息', res);
        console.log(res.data.data.length);
        if (res.data.success == true) {
          this.items = res.data.data;
        } else {
          this.repeat_click = true;
          uni.showToast({
            title: res.data.msg,
            icon: 'none',
          });
        }
      },
      fail: () => {
        this.repeat_click = true;
        uni.showToast({
          title: '服务器开小差，请稍后~',
          icon: 'none',
        });
        return false;
      },
    });
  },

  methods: {
    to_rl() {
      uni.navigateTo({
        url: '../main/close',
      });
    },
    to_edit(a, b) {
      if (b == 2) {
        uni.navigateTo({
          url: '../main/mac',
        });
        return;
      }
      var cc = b - 1;
      uni.setStorageSync('lsbt', a);
      uni.setStorageSync('temp_data1', this.items[cc]);
      if (b) {
        uni.setStorageSync('lsid', b);
      }
      uni.navigateTo({
        url: '../main/fbclose_list',
      });
    },

    to_edit2(a, b) {
      var cc = b - 1;
      uni.setStorageSync('lsbt', a);
      uni.setStorageSync('temp_data1', this.items[cc]);
      if (b) {
        uni.setStorageSync('lsid', b);
      }
      uni.navigateTo({
        url: '../main/fbclose_listtwo2',
      });
    },

    to_edit22() {
      uni.navigateTo({
        url: '../main/wf',
      });
    },

    // 跳转
    to_add() {
      uni.navigateTo({
        url: '../main/need_add',
      });
    },
    // 跳转
    jshow_pop() {
      this.ashowpop = !this.ashowpop;
    },

    navigateBack() {
      uni.navigateBack();
    },
  },
  computed: mapState(['forcedLogin', 'hasLogin', 'userName']),
};
</script>

<style>
.tophr {
  width: 100%;
  height: 88rpx;
}
.uni-searchbar {
  box-shadow: none;
}

.ci {
  width: 690rpx;
  height: 180rpx;
  background: #eb5342;
  box-shadow: 0px 20rpx 30rpx rgba(0, 0, 0, 0.100333);
  border-radius: 12rpx;
  margin: 30rpx;
}
.ci_b {
  width: 33%;
  height: 72rpx;
  display: block;
  float: left;
  box-sizing: border-box;
  margin: 57rpx 0 0 0;
  border-right: 1px solid rgba(255, 255, 255, 0.3);
}
.ci_bt {
  width: 100%;
  height: auto;
  color: #ffffff;
  font-size: 20rpx;
  line-height: 28rpx;
  display: block;
  float: left;
  margin: 0rpx 0 0rpx 0;
  text-align: center;
}
.ci_bf {
  width: 100%;
  height: auto;
  color: #ffffff;
  font-size: 32rpx;
  line-height: 32rpx;
  display: block;
  float: left;
  margin: 20rpx 0 0rpx 0;
  text-align: center;
}
.ci .ci_b:last-child {
  border: 0;
}

.cli {
  width: 100%;
  height: auto;
  display: block;
  float: left;
}
.clb {
  width: 720rpx;
  height: auto;
  display: block;
  float: right;
  border-bottom: 1px solid #dddddd;
  margin: 18rpx 0 0 0;
}
.clb image {
  width: 84rpx;
  height: 84rpx;
  display: block;
  float: left;
  margin: 0rpx 20rpx 18rpx 0rpx;
}
.clb_t {
  width: 600rpx;
  height: auto;
  display: block;
  float: left;
}
.clfb_tt {
  width: 100%;
  height: auto;
  color: #000000;
  font-size: 34rpx;
  line-height: 42rpx;
  display: block;
  float: left;
  margin: 0 0 10rpx 0;
}
.clfb_tf {
  width: 100%;
  height: auto;
  color: #999999;
  font-size: 24rpx;
  line-height: 32rpx;
  display: block;
  float: left;
}
.clfb_tt text {
  float: right;
  color: #cccccc;
  font-size: 24rpx;
  line-height: 32rpx;
  display: none;
}

.tc {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  display: block;
}
.jtop_bj {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
}
.tc_fbox_bt {
  width: 100%;
  height: 90rpx;
  line-height: 90rpx;
  display: block;
  float: left;
  text-align: center;
  font-size: 36rpx;
  color: #000000;
  border-top: 20rpx solid #f2f2f2;
  background: #ffffff;
}
.tc_fbox {
  width: 100%;
  height: auto;
  display: block;
  float: left;
  background: #f2f2f2;
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 10001;
}
.tc_fbox_bt2 {
  width: 100%;
  height: 90rpx;
  line-height: 90rpx;
  display: block;
  float: left;
  text-align: center;
  font-size: 36rpx;
  color: #000000;
  border-top: 0rpx solid #f2f2f2;
  background: #ffffff;
}
.tc_fbox_bt3 {
  width: 100%;
  height: 90rpx;
  line-height: 90rpx;
  display: block;
  float: left;
  text-align: center;
  font-size: 36rpx;
  color: #000000;
  border-bottom: 1px solid #dddddd;
  background: #ffffff;
}
.clb {
  position: relative;
}
.clb image.blb_r {
  width: 16rpx;
  height: 25rpx;
  display: block;
  float: right;
  margin: 30rpx 30rpx 0 0rpx;
  position: absolute;
  top: 0rpx;
  right: 0rpx;
}

.doc_bs {
  width: 100%;
  height: auto;
  display: block;
  float: left;
  background: #ffffff;
}
.doc_b {
  width: 720rpx;
  height: auto;
  display: block;
  float: left;
  background: #ffffff;
  border-bottom: 1px solid #dddddd;
  margin: 0 0 0 30rpx;
}
/* .doc_bs .doc_b:last-child{ border: 0;} */
.doc_bl {
  width: 48rpx;
  height: 48rpx;
  display: block;
  float: left;
  margin: 36rpx 30rpx 36rpx 0;
}
.doc_bt {
  width: auto;
  height: 42rpx;
  line-height: 42rpx;
  font-size: 34rpx;
  display: block;
  float: left;
  color: #000000;
  margin: 37rpx 0 0 0;
}
.doc_br {
  width: 48rpx;
  height: 48rpx;
  display: block;
  float: right;
  margin: 32rpx 30rpx 32rpx 0;
}
.doc_b2 {
  width: 600rpx;
  height: auto;
  display: block;
  float: left;
}
.doc_b2t {
  width: 600rpx;
  height: auto;
  font-size: 34rpx;
  line-height: 42rpx;
  color: #000000;
  margin: 18rpx 0 10rpx;
  display: block;
  float: left;
}
.doc_b2f {
  width: 600rpx;
  height: auto;
  font-size: 24rpx;
  line-height: 32rpx;
  color: #fc9422;
  margin: 0rpx 0 rpx;
  display: block;
  float: left;
}

.index {
  background: #ffffff;
  width: 100%;
  height: auto;
}
.jtop {
  width: 100%;
  height: 88rpx;
  background: #ffffff;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: inset 0px -1px 0px #dddddd;
}
.jtop_l {
  width: auto;
  height: 88rpx;
  display: block;
  float: left;
  font-size: 32rpx;
  color: #000000;
  line-height: 88rpx;
  margin: 0 0 0 30rpx;
}
.jtop_l image {
  width: 48rpx;
  height: 48rpx;
  display: block;
  float: left;
  margin: 20rpx 0 20rpx 0;
}
.jtop_lt {
  margin: 0 0 0 10rpx;
}
.jtop_r {
  width: 48rpx;
  height: 48rpx;
  display: block;
  float: right;
  margin: 20rpx 20rpx 0 0;
}
.jtop_rl {
  margin: 20rpx 30rpx 0 0;
}
.jtop_r image {
  width: 48rpx;
  height: 48rpx;
  display: block;
  float: left;
}
.jtop_c {
  width: 70%;
  height: 48rpx;
  line-height: 48rpx;
  display: block;
  float: left;
  position: fixed;
  top: 20rpx;
  left: 15%;
  text-align: center;
  font-size: 36rpx;
  color: #000000;
}
.jtop_c image {
  width: 36rpx;
  height: 36rpx;
  display: inline-block;
  float: none;
  margin-bottom: -5rpx;
  margin-left: 5rpx;
}
.jtop_b {
  width: 100%;
  height: auto;
  background: #ffffff;
  position: fixed;
  top: 88rpx;
  left: 0;
  z-index: 1001;
}

.doc_b22 {
  opacity: 0.5;
}

.nd {
  width: 735rpx;
  height: auto;
  display: block;
  float: left;
  margin: 0 0 0 0rpx;
}
.nd_bt {
  width: auto;
  height: 48rpx;
  display: block;
  float: right;
  border: 1px solid #dddddd;
  border-radius: 24rpx;
  margin: 40rpx 0 40rpx 30rpx;
}
.nd_bt text {
  width: auto;
  height: 48rpx;
  display: block;
  float: left;
  margin: 0 7rpx 0 18rpx;
  line-height: 48rpx;
  color: #666666;
  font-size: 24rpx;
}
.nd_bt image {
  width: 13rpx;
  height: 8rpx;
  display: block;
  float: left;
  margin: 21rpx 14rpx 0 0;
}
</style>
